package cn.mjnxin.iot.base.domain;

import java.io.Serializable;
/**
 * 一个客户端请求所对应的所有数据对象
 * @author CLG 2023年10月10日
 * @version V1.0.0
 */
public class ChannelData implements Serializable{
    private static final long serialVersionUID = -7164069554228806843L;
    
    /**
     * 标题
     */
    private String title;
    
	/**
	 * 网关地址
	 */
	private String gateAddress;
    /**
     * 设备地址
     */
    private String terminalAddress;
    /**
     * 前置地址
     */
    private String hostAddress;

	private Integer gateNum;
	
	private boolean isIPV4 = true;
    
	private Integer type;
    
	private Integer pid;

	// 日志等级 0：无日志 1：报文长度日志 2：报文内容日志 3：所有日志
	private Integer logLevel;
    
    private SocketData socketData;
    
    /**
     * 根据SocketData创建对象
     */
    public ChannelData(Integer logLevel, SocketData socketData) {
        this(null, null, logLevel, socketData);
    }
    
    public ChannelData(Integer pid, Integer logLevel, SocketData socketData) {
        this.pid = pid;
        this.logLevel = logLevel;
        this.socketData = socketData;
    }

    public ChannelData(String terminalAddress, Integer pid, Integer logLevel, SocketData socketData) {
        this.terminalAddress = terminalAddress;
        this.pid = pid;
        this.logLevel = logLevel;
        this.socketData = socketData;
    }

    public ChannelData(String gateAddress, String terminalAddress, Integer pid, Integer logLevel, SocketData socketData) {
        this(terminalAddress, pid, logLevel, socketData);
        this.gateAddress = gateAddress;
    }

	public String getGateAddress() {
		return gateAddress;
	}

	public void setGateAddress(String gateAddress) {
		this.gateAddress = gateAddress;
	}
	
	public String getTerminalAddress() {
        return terminalAddress;
    }
	
    public void setTerminalAddress(String terminalAddress) {
        this.terminalAddress = terminalAddress;
    }
    
    public SocketData getSocketData() {
        return socketData;
    }
    
    public void setSocketData(SocketData socketData) {
        this.socketData = socketData;
    }

	public Integer getPid() {
		return pid;
	}

	public void setPid(Integer pid) {
		this.pid = pid;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	/**
	 * @return the gateNum
	 */
	public Integer getGateNum() {
		return gateNum;
	}

	/**
	 * @param gateNum the gateNum to set
	 */
	public void setGateNum(Integer gateNum) {
		this.gateNum = gateNum;
	}

	/**
	 * @return the isIPV4
	 */
	public boolean isIPV4() {
		return isIPV4;
	}

	/**
	 * @param isIPV4 the isIPV4 to set
	 */
	public void setIPV4(boolean isIPV4) {
		this.isIPV4 = isIPV4;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String tag) {
		this.title = tag;
	}

	/**
	 * @return the hostAddress
	 */
	public String getHostAddress() {
		return hostAddress;
	}

	/**
	 * @param hostAddress the hostAddress to set
	 */
	public void setHostAddress(String hostAddress) {
		this.hostAddress = hostAddress;
	}

	public Integer getLogLevel() {
		return logLevel;
	}

	public void setLogLevel(Integer logLevel) {
		this.logLevel = logLevel;
	}
}
